package com.atguigu.gulimall.search.controller;

import com.atguigu.common.no.es.SkuEsModel;
import com.atguigu.common.no.utils.R;
import com.atguigu.gulimall.search.services.ProductSaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author xiaopeng
 * @date 2020-11-3 20:15
 */

@RestController
@RequestMapping("/search")
public class ElasticSaveController {

@Autowired
    private ProductSaveService productSaveService;

    @PostMapping("/save")
    public R productstatusUp(@RequestBody List<SkuEsModel> skuEsModels) {
        System.out.println("98745628******************");
        productSaveService.upEsModes(skuEsModels);
        return R.ok();
    }

}
